Skip to content

Conversation

@syedshazli
Copy link
Contributor

@syedshazli syedshazli commented Dec 2, 2025

In the CUDA Coredump blog, an incorrect documentation statement is made for this kernel:

// Kernel with illegal memory access - accesses memory beyond allocated bounds
global void normalKernel(int* data, int size) {
int idx = blockIdx.x * blockDim.x + threadIdx.x;

// This will cause illegal memory access - accessing beyond allocated memory
// We allocate 'size' elements but access up to size * 2
if (idx < size) { // Access twice the allocated size
data[idx] = idx; //
}
}

To my knowledge, this should not generate an illegal memory access, as the size allocated is fine in the source code as well, and we clearly check if the index is less than the size allocated before writing to the array. There is also an incomplete comment for data[idx] = idx; so I'm making the assumption that these comments are a mistake

I also removed the use of the phrase 'normal execution' as it can confuse readers who may think the author is referring to the execution of the kernel called 'normalKernel.' I have replaced the wording to just be 'execution.'

Signed-off-by: syedshazli <syed.abdu1818@gmail.com>
Signed-off-by: syedshazli <syed.abdu1818@gmail.com>
@syedshazli
Copy link
Contributor Author

cc @youkaichao, author of the blog

@youkaichao
Copy link
Member

makes sense, thank you!

@youkaichao youkaichao merged commit 6f9f75d into vllm-project:main Dec 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants